var webpack = require("webpack");
var path = require("path");
var buildPath = path.resolve(__dirname, 'dist/');

module.exports = {
    cache: true,
    //entry: {'index.entry':"./src/index/xuqiu.entry.js"},
    entry: {

    },
    output: {
        path: buildPath,
        filename: '[name].js'
    },
    resolve: {
        extensions: ['', '.js', '.jsx', '.txt', '.css', '.scss', '.tpl', '.html']
    },
    devtool: 'source-map',
    moduleDirectories: [
        "node_modules"
    ],

    module: {
        loaders: [
            // required to write "require('./style.css')"
            { test: /\.css$/, loader: "style-loader!css-loader!autoprefixer-loader?{browsers:['last 2 versions', 'ie >= 7']}" },
            { test: /\.scss$/, loader: "style!css!sass!autoprefixer-loader?{browsers:['last 2 versions', 'ie >= 7']}"},
            // required for react jsx
            { test: /\.(js|jsx)$/,   loader: "babel-loader" },
            { test: /\.(tpl|html)$/,   loader: "html-loader" }
        ]
    }  /*,
    plugins: [
        new webpack.ProvidePlugin({
            // Automtically detect jQuery and $ as free var in modules
            // and inject the jquery library
            // This is required by many jquery plugins
            jQuery: "jquery",
            $: "jquery"
        })
    ]*/
};